﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DotNet.WebUI
{
    /// <summary>
    /// 基本页面，构建常用方法的封装
    /// </summary>
    public class BasePage : BasicPage
    {
        public BasePage()
        {

        }

        protected string GetQueryString(string QueryString, string DefaultValue)
        {
            return (Request.QueryString[QueryString] == null) ? DefaultValue : Request.QueryString[QueryString].ToString();
        }

        public void MessageBox(string info)
        {
            Response.Write(string.Format("<script type='text/javascript' language='javascript'>alert('{0}')</script>", info));
        }

        public string GetUserName(string LoginID)
        {
            string _Sql = @"SELECT UserName 
                FROM Users 
                WHERE LoginID = '{0}'";
            _Sql = string.Format(_Sql, LoginID);

            return ExecuteScalar(_Sql).ToString();
        }
    }
}